<?php

namespace app\models;
use yii\db\ActiveRecord;

class Article extends ActiveRecord{
	/**
	 * [getCategory 获取文章类别 一对一的关系]
	 * @return [type] [description]
	 */
	public function getCategory(){
		return $this -> hasOne(Category::className(),['id' => 'cate_id']) -> asarray();//-> all()/one();
	}
	
}